import { Alova } from '@/utils/http/alova/index';

export interface Licenseinfo {
  antiInterferenceLevel: number;
  dataEncryptionAES256: boolean;
  deviceList: string[];
  extendSpan: boolean;
  freqSmart: boolean;
  maxHopNum: number;
  maxNodeNum: number;
  maxThroughput: number;
  supportedWaveform: number;
  time: string;
}

export interface DeviceInfo {
  bootSystems: number[];
  chipLevel: number;
  defaultVersion: string;
  deviceSn: string;
  deviceType: string;
  enduserName: string;
  freqMax: number;
  freqMin: number;
  freqOffsetRatio: number;
  licenseinfo: Licenseinfo;
  powerMax: number;
  powerMaxAtten: number;
  powerMaxAtten2: number;
  supplementaryFreqBands: any[];
  swapRxIQ: boolean;
  swapTxIQ: boolean;
  userName: string;
  version: string;
  wifiChannels: number[];
}

// 获取设备信息
export function getDeviceInfoApi() {
  return Alova.Get<DeviceInfo>('/deviceinfo', {
    meta: {
      isReturnNativeResponse: true, // 关键配置, 返回原生响应头
    },
  });
}
